package com.vastcom.tyauthcenter.config;

import com.vastcom.tyauthcenter.tools.JwtUtil;
import feign.RequestInterceptor;
import feign.RequestTemplate;
import org.springframework.stereotype.Repository;

@Repository
public class AdminFeiginConfig implements RequestInterceptor {

    private String getAdminUserToken(){
        String token= JwtUtil.generateToken("admin","authcenter");

        return token;


    }




    @Override
    public void apply(RequestTemplate requestTemplate) {
        String token=getAdminUserToken();
        requestTemplate.header("Content-Type", "application/json");
        requestTemplate.header("Accept", "application/json");
        requestTemplate.header("Passport", token);

    }
}
